home *** CD-ROM | disk | FTP | other *** search
- Path: red.seas.upenn.edu!mchyzer
- From: mchyzer@red.seas.upenn.edu (Michael C Hyzer)
- Newsgroups: comp.lang.c
- Subject: Writing to a Memory Address
- Date: 4 Apr 1996 08:08:25 GMT
- Organization: University of Pennsylvania
- Message-ID: <4k001p$dqb@netnews.upenn.edu>
- NNTP-Posting-Host: red.seas.upenn.edu
- X-Newsreader: TIN [version 1.2 PL2-upenn1.3]
-
- Hello,
- I am running the same gcc for DOS on my pentium desktop and 386 laptop.
- I am trying to write to the address of the parallel port (0x0378 on both
- machines). When i do it on the desktop, with a command such as:
-
- int *para = (char *)0x0378;
-
- This line causes a segmentation violation on the laptop. When I use this
- line on the desktop, it will complete the assignment, and I can read and
- write to the address. When I boot the desktop without drivers (hitting
- F5 during startup), the C program will not run, and the segmentation
- violation is identical to the laptop. Another piece of information that
- might help, is that the memory addresses for normal assignments on the
- laptop consists of addresses such as: 0x7FFFFE58. This is the same
- magnitude of address that the desktop uses when it does not run
- properly. When the desktop does run properly, it uses addresses such as
- 0x51E54. It seems that when C uses this block of memory, it can access
- the memory address 0x0378. But when C is using the high memory, it
- cannot access the low memory, even to read it.
-
- My question is: Does anyone know how to load gcc so it uses low memory.
- I am using the same memory manager on both machines, and trying to
- duplicate the config.sys, but no luck.
- Does anyone know how to write to an address that is locked out by C using
- usual commands.
- Is there another easy way to change the pins of the parallel port without
- using C, if using C is unfeasable. I want to change the voltage at
- certain pins without start and stop bits, or however it normally
- operates.
- If you dont have enough information, or you have suggestions, please
- email me at:
- mchyzer@seas.upenn.edu
- Thank you very much.
- Chris Hyzer
-
-